﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    /// <summary>
    /// 装备
    /// </summary>
    public class Equipment : Thing
    {
        static Dictionary<ushort, Enum装备类型> normalDict = new Dictionary<ushort, Enum装备类型>();
        static Dictionary<ushort, Enum装备类型> betterDict = new Dictionary<ushort, Enum装备类型>();

        /// <summary>
        /// 附加属性数量
        /// </summary>
        public int EximiousCount { get; set; }

        /// <summary>
        /// 附加属性编号集合
        /// </summary>
        public List<int> EximiousList { get; set; }

        /// <summary>
        /// 装备战力
        /// </summary>
        public int Power { get; set; }

        /// <summary>
        /// 是否卓越装备
        /// </summary>
        public bool IsEximious { get; set; }

        static Equipment()
        {
            normalDict.Add(0x8827, Enum装备类型.武器);
            normalDict.Add(0xE133, Enum装备类型.头盔);
            normalDict.Add(0x9F34, Enum装备类型.鞋子);
            normalDict.Add(0x8034, Enum装备类型.护手);
            normalDict.Add(0xD133, Enum装备类型.铠甲);
            normalDict.Add(0x8F34, Enum装备类型.护腿);

            betterDict.Add(0x8827, Enum装备类型.武器);
            betterDict.Add(0xE133, Enum装备类型.头盔);
            betterDict.Add(0x9F34, Enum装备类型.鞋子);
            betterDict.Add(0x8034, Enum装备类型.护手);
            betterDict.Add(0xD133, Enum装备类型.铠甲);
            betterDict.Add(0x8F34, Enum装备类型.护腿);
        }

        public static Enum装备类型 GetEnumType(ushort type)
        {
            if (normalDict.ContainsKey(type)) { return normalDict[type]; }
            if (betterDict.ContainsKey(type)) { return betterDict[type]; }
            return Enum装备类型.未知;
        }
    }
}
